/* GUI CONVERTED from relnrp.p (converter v1.75) Sat Aug 12 23:06:04 2000 */
/* relnrp.p - PRODUCTION LINE DETAIL REPORT                              */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                   */
/* All rights reserved worldwide.  This is an unpublished work.          */
/* web convert relnrp.p (converter v1.00) Fri Oct 10 13:57:17 1997 */
/* web tag in relnrp.p (converter v1.00) Mon Oct 06 14:17:42 1997 */
/*F0PN*/ /*K0Z1*/ /*                                                    */
/*V8:ConvertMode=FullGUIReport                                  */
/* REVISION: 7.0       LAST MODIFIED: 02/25/92       BY: SMM  *F230*/
/* REVISION: 7.0       LAST MODIFIED: 03/29/92       BY: emb  *F331*/
/* REVISION: 7.0       LAST MODIFIED: 05/26/92       BY: emb  *F530*/
/* REVISION: 8.6       LAST MODIFIED: 10/14/97       BY: bvm  *K0Z1*/
/* REVISION: 9.1      LAST MODIFIED: 03/24/00 BY: *N08T* Annasaheb Rahane */
/* REVISION: 9.1      LAST MODIFIED: 08/12/00 BY: *N0KP* myb              */


/*GUI global preprocessor directive settings */
&GLOBAL-DEFINE PP_PGM_RP TRUE
&GLOBAL-DEFINE PP_ENV_GUI TRUE


/*GUI preprocessor directive settings */
&SCOPED-DEFINE PP_GUI_CONVERT_MODE REPORT

/*K0Z1*/ {mfdtitle.i "b+ "}

define variable line      like  rps_line.
define variable line1     like  ln_line.
define variable site      like  ln_site.
define variable site1     like  ln_site.
define variable part      like  pt_part.
define variable part1     like  pt_part.
define variable date1     like  lnd_start.
define variable date2     like  lnd_start.

/*K0Z1* {mfdtitle.i "b+ "} /*F530*/ **moved up*/


/*GUI preprocessor Frame A define */
&SCOPED-DEFINE PP_FRAME_NAME A

FORM /*GUI*/ 
  
 RECT-FRAME       AT ROW 1.4 COLUMN 1.25
 RECT-FRAME-LABEL AT ROW 1   COLUMN 3 NO-LABEL
 SKIP(.1)  /*GUI*/
site  colon 20
  site1 colon 45 label {t001.i}
  line  colon 20
  line1 colon 45 label {t001.i}
  part  colon 20
  part1 colon 45 label {t001.i}
  date1 colon 20
  date2 colon 45 label {t001.i}
  skip
 SKIP(.4)  /*GUI*/
with frame a width 80 side-labels NO-BOX THREE-D /*GUI*/.

 DEFINE VARIABLE F-a-title AS CHARACTER.
 F-a-title = &IF (DEFINED(SELECTION_CRITERIA) = 0)
  &THEN " Selection Criteria "
  &ELSE {&SELECTION_CRITERIA}
  &ENDIF .
 RECT-FRAME-LABEL:SCREEN-VALUE in frame a = F-a-title.
 RECT-FRAME-LABEL:WIDTH-PIXELS in frame a =
  FONT-TABLE:GET-TEXT-WIDTH-PIXELS(
  RECT-FRAME-LABEL:SCREEN-VALUE in frame a + " ", RECT-FRAME-LABEL:FONT).
 RECT-FRAME:HEIGHT-PIXELS in frame a =
  FRAME a:HEIGHT-PIXELS - RECT-FRAME:Y in frame a - 2.
 RECT-FRAME:WIDTH-CHARS IN FRAME a = FRAME a:WIDTH-CHARS - .5. /*GUI*/

/*GUI preprocessor Frame A undefine */
&UNDEFINE PP_FRAME_NAME



/* SET EXTERNAL LABELS */
setFrameLabels(frame a:handle).

site = global_site.
site1 = global_site.

/*K0Z1*/ {wbrp01.i}


/*GUI*/ {mfguirpa.i true  "printer" 132 }

/*GUI repeat : */
/*GUI*/ procedure p-enable-ui:


   if site1 = hi_char then site1 = "".
   if line1 = hi_char then line1 = "".
   if part1 = hi_char then part1 = "".
   if date1 = low_date then date1 = ?.
   if date2 = hi_date  then date2 = ?.

/*K0Z1*/ if c-application-mode <> 'web' then
   
run p-action-fields (input "display").
run p-action-fields (input "enable").
end procedure. /* p-enable-ui, replacement of Data-Entry GUI*/

/*GUI*/ procedure p-report-quote:


/*K0Z1*/ {wbrp06.i &command = update &fields = "  site site1 line line1 part part1
          date1 date2" &frm = "a"}

/*K0Z1*/ if (c-application-mode <> 'web') or
/*K0Z1*/ (c-application-mode = 'web' and
/*K0Z1*/ (c-web-request begins 'data')) then do:

   bcdparm = "".
   {mfquoter.i site   }
   {mfquoter.i site1  }
   {mfquoter.i line   }
   {mfquoter.i line1  }
   {mfquoter.i part   }
   {mfquoter.i part1  }
   {mfquoter.i date1  }
   {mfquoter.i date2  }

   if date2  = ?  then date2   = hi_date.
   if date1  = ?  then date1   = low_date.
   if part1 = "" then part1 = hi_char.
   if site1 = "" then site1 = hi_char.
   if line1 = "" then line1 = hi_char.

/*K0Z1*/ end.

   
/*GUI*/ end procedure. /* p-report-quote */
/*GUI - Field Trigger Section */

/*GUI MFSELxxx removed*/
/*GUI*/ procedure p-report:
/*GUI*/   {gpprtrpa.i  "printer" 132}
/*GUI*/   mainloop: do on error undo, return error on endkey undo, return error:



   {mfphead.i}

   for each ln_mstr no-lock where (ln_site >= site and ln_site <= site1)
   and (ln_line >= line and ln_line <= line1)
/*F530*/ by ln_site by ln_line
   with frame b:

     FORM /*GUI*/  ln_site ln_line
/*F530*     ln_desc       column-label "Description"
        ln_rate_base  column-label "Rate!Based"
        lnd_part      column-label "Item Number" */
/*F530*/    pt_part
/*F530*/    pt_desc1
        lnd_start
        ln_rate
        lnd_prod_um
        lnd_setup
        lnd_run
     with STREAM-IO /*GUI*/  frame b down width 132.

     /* SET EXTERNAL LABELS */
     setFrameLabels(frame b:handle).

      display ln_site ln_line
      ln_desc
/*F530*/ @ pt_desc1
/*F530*  ln_rate_base */
      ln_rate with frame b STREAM-IO /*GUI*/ .

      down 1.

      for each lnd_det no-lock where lnd_site = ln_site
      and lnd_line = ln_line
      and (lnd_part >= part and lnd_part <= part1)
      and (lnd_start >= date1 and lnd_start <= date2)
/*F530*/ break by lnd_line by lnd_site by lnd_part by lnd_start
/*F530*  by lnd_site by lnd_line by lnd_part by lnd_start */
      with frame b:

/*F530*/ find pt_mstr no-lock where pt_part = lnd_part no-error.

/*F530*/ if first-of (lnd_part) then do with frame b:
        display lnd_part
/*F530*/    @ pt_part WITH STREAM-IO /*GUI*/ .
/*F530*/    if available pt_mstr then display pt_desc1 WITH STREAM-IO /*GUI*/ .
/*F530*/ end.

/*F530*/ display
     lnd_start
     lnd_rate @ ln_rate
/*F530*  lnd_prod_um */
     lnd_setup lnd_run lnd_tool WITH STREAM-IO /*GUI*/ .

/*F530*/ if available pt_mstr then
/*F530*/    display pt_um @ lnd_prod_um WITH STREAM-IO /*GUI*/ .

     down 1.

/*F530*/ if available pt_mstr and pt_desc2 <> "" and first-of (lnd_part)
/*F530*/ then do with frame b:
/*F530*/    display pt_desc2 @ pt_desc1 WITH STREAM-IO /*GUI*/ .
/*F530*/    down 1.
/*F530*/ end.

     if page-size - line-counter < 4 then page.

     
/*GUI*/ {mfguirex.i  "false"} /*Replace mfrpexit*/

      end. /* for each */

      
/*GUI*/ {mfguirex.i } /*Replace mfrpexit*/

   end.

   
/*GUI*/ {mfguitrl.i} /*Replace mfrtrail*/

/*GUI*/ {mfgrptrm.i} /*Report-to-Window*/

end. /* repeat */

/*K0Z1*/ {wbrp04.i &frame-spec = a}

/*GUI*/ end procedure. /*p-report*/
/*GUI*/ {mfguirpb.i &flds=" site site1 line line1 part part1 date1 date2 "} /*Drive the Report*/
